<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script>
    /* 将数组[ 2,0,6,1,77,0,52,0,25,7]中的0去掉*/
    var arr = [2,0,6,1,77,0,52,0,25,7];
    var newarr = [];
    for(var i = 0; i<arr.length;i++){
        if(arr[i] == 0){
            continue;
        }
       newarr[newarr.length] = arr[i];
    }console.log(newarr);

    //将数组['red','pink','blue','green','red']的内容反过来存放
    var arr1 = ['red','pink','blue','green','purple'];
    var newarr1 = [];
    for(var i = arr1.length-1; i>=0; i--){
        newarr1[newarr1.length] = arr1[i];
    }console.log(newarr1);

    //
</script>
<body>
    
</body>
</html>